<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: column_left.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: peter $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

function getActiveMenu($m_name, $g_id = 0) {
	global $uri;
	
	if(($g_id != 0) && ($g_id == $_GET['gID']) && $m_name == $uri)
		return ' class="menu_link_aktiv"';
	elseif($m_name == $uri && $uri !='configuration')
		return ' class="menu_link_aktiv"';
}

$group = $db->db_query("SELECT agID FROM ".TABLE_ADMIN_ACCESS_GROUPS." WHERE cID = '".$_SESSION['customer_id']."' ");

$getMenuLinks = $db->db_query("SELECT DISTINCT
									acm.mID,
									acm.menu_name,
									acm.group_id,
									acm.parent_id,
									acm.visible,
									acm.sort_order,
									acm.title_language_id_".$_SESSION['languages_id']."
								FROM
									".TABLE_ADMIN_MENU." acm,
									".TABLE_ADMIN_ACCESS_RIGHTS." aar
								WHERE
									acm.parent_id = '".(int)$_GET['menu']."'
								AND
									(acm.menu_name = aar.file_name OR aar.file_name LIKE CONCAT(acm.menu_name,'-',acm.group_id))
								AND
									acm.visible = 1
								AND
									aar.g_".$_SESSION['customers_status']['customers_admin_id']." = '1'
								ORDER BY
									acm.sort_order ASC 
								");

if($getMenuLinks->_numOfRows) {
	echo '<div class="menu_items dn">';
	while(!$getMenuLinks->EOF) {
	
		echo '<a'.getActiveMenu($getMenuLinks->fields['menu_name'], $getMenuLinks->fields['group_id']).' href="'.$getMenuLinks->fields['menu_name'].'.php?menu='.(int)$_GET['menu'].(!empty($getMenuLinks->fields['group_id']) ? '&gID='.$getMenuLinks->fields['group_id']:'').'">'.$getMenuLinks->fields['title_language_id_'.$_SESSION['languages_id']].'</a>';

		$getMenuLinks->MoveNext();
	}
	echo '</div>';
	echo '	<script type="text/javascript">
				$(function(){$(".columnLeft2").css("width","200px");$(".menu_items").fadeIn();});
			</script>';

} else {
	echo '	<script type="text/javascript">
				$(function(){$(".columnLeft2").remove();$(".boxCenter").css("paddingLeft",0);});
			</script>';
}
?>